//加法运算
let a= 1234;

let res = a +1;//不会对a产生影响

res = true +1;//2,先将true转成1在计算
res = true + false;//1，将两个布尔值都转换在计算
res = 2 + NaN;//NaN,任何数与NaN运算结果都是NaN
res = "只因你" + "太美";//只因你太美,字符串拼接
res = true + "太美";//true太美
console.log(res)

//可以将任意数据类型+""转换为string
let c = 1 + "";

console.log("c = " + c)

let d = 1 + 2 + "3";//"33"
d = "1" + 2 + 3;//"123"

console.log(d);

//减法
let e = 100 -"1";//99
e = 100 - undefined;//NaN
e = 100 * 2;//200
e = 100 * undefined;//NaN
e = 100 / 2;//50
// e = 100 / undefined;//NaN

//利用任何值做-、*、/运算时都会自动转换为number
e = "114514" - 0;

console.log(e);
console.log(typeof e);

